import { myRequest } from './api.js'

const SDKAppID=()=>{
	return '1400467791';
}

// 一键登陆
const loginToken = async function(params) {
	return await myRequest({url: '/visitor/loginToken',method: 'POST', data: params})
}

// 发送验证码
const sendCode = async function(params) {
	return await myRequest({url: '/client/visitor/sendcode',method: 'POST', data: params})
}

// 验证码登录
const userCodeLogin = async function(params) {
	return await myRequest({url: '/client/visitor/login',method: 'POST', data: params})
}

// 密码登录
const loginPassword = async function(params) {
	return await myRequest({url: '/client/visitor/loginPassword',method: 'POST', data: params, loading: true})
}

// 图片上传
const uploadImage = async function(params) {
	return await myRequest({url: '/client/visitor/uploadImage',method: 'POST', data: params})
}

// 获取新版本
const getVeision = async function(params) {
	return await myRequest({url: '/client/visitor/getVeision', data: params})
}

// 获取客服
const getService = async function(params) {
	return await myRequest({url: '/client/visitor/getService', data: params})
}

// 微信登录
const wxLogin = async function(params) {
	return await myRequest({url: '/client/visitor/auth', data: params, method: 'POST'})
}

// 判断是否开启微信登录
const getLoginWX = async function(params) {
	return await myRequest({url: '/client/visitor/getLogin', data: params})
}

export {
	SDKAppID,
	// loginToken
	sendCode,
	userCodeLogin,
	loginPassword,
	uploadImage,
	getVeision,
	getService,
	wxLogin,
	getLoginWX
}